<template>
  <div></div>
</template>

<script>
import { defineComponent } from "vue"
export default defineComponent({
  components: {

  },
  data() {
    return {

    }
  },
  methods: {

  },
  async mounted() {
    const loading = this.$loading({lock:true})
    if (this.$route.query.guid) {
      let res = await this.$http.get("/api/AuthUser/GetTokenByGuid", {
        guid: this.$route.query.guid
      })
      // 登录
      await this.$store.dispatch("auth/setTokenAndGetInfo", res).catch(()=>{})
      await this.$router.replace("/")
      this.$message.success("登录成功")
    } else {
      // 注册
      await this.$router.replace({
        path: "/wxBind",
        query: {
          BindToken: this.$route.query.BindToken
        }
      })
    }
    loading.close();

  }
})
</script>

<style lang='scss' scoped>
</style>